package basisRouter

import (
	"github.com/Sir-yuChen/funAnalyse/api"
	"github.com/Sir-yuChen/funAnalyse/global"
	"github.com/Sir-yuChen/funAnalyse/middleware"
	"github.com/gin-gonic/gin"
)

type StockFilesRouter struct{}

func (co *StockFilesRouter) StockFilesApiRouter(Router *gin.RouterGroup) {
	commonJwtRouter := Router.Group(global.ROUTER_GROUP_FILE).Use(middleware.JWTAuth()).Use(middleware.CasbinMiddleware())
	api := api.ApiGroupApp.BasisApiGroup.StockFilesController
	{
		commonJwtRouter.GET(global.API_Files_GET.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Files_GET), api.GetStockFiles)
		commonJwtRouter.POST(global.API_Files_INSERT.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Files_INSERT), api.UploadFile)
		commonJwtRouter.POST(global.API_Files_UPDATE.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Files_UPDATE), api.UpdateStockFiles)
		commonJwtRouter.GET(global.API_Files_DEL.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Files_DEL), api.DelStockFiles)
		commonJwtRouter.GET(global.API_Files_Download.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Files_Download), api.DownloadFile)
	}
}
